package com.leetcode;

import java.util.Arrays;
import java.util.Scanner;

public class 判断是不是子字符串 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextLine()) {
            String s = scanner.nextLine();
            String t = scanner.nextLine();
            int[] ints = new int[s.length()];
            int p1 = 0, p2 = 0;
            while (p1 < s.length() && p2 < t.length()) {
                char c1 = s.charAt(p1);
                char c2 = t.charAt(p2);
                if (c1 == c2) {
                    ints[p1] = p2;
                    p1 += 1;

                }
                p2 += 1;
            }
            System.out.println(p1 == s.length());
            System.out.println(Arrays.toString(ints));
        }
    }
}
